#!/usr/bin/env python
import MySQLdb
import pdb

conn = MySQLdb.Connection('192.168.1.211', 'root', 'boogu737', 'net114')
#conn = MySQLdb.Connection('192.168.1.200', 'sellgreat', 'u*92%jDkde^L', 'sellgreat')

cur = conn.cursor()
cur.execute('set names gbk')
sql = "select id, title from sw_article;"


re = cur.execute(sql)

res = cur.fetchall()
for id, cnt in res:
	if cnt:
		cnt = cnt.replace('\n', '\\n')
		print "%d|||%s" % (id, cnt)
